<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // string number boolean 基本类型 会被包装对象
        let str = 'a b c'
        //模仿包装对象
        function mysplit(str, method, arg) {
            let temp = new String(str);
            return temp[method](arg);
            //销毁包装对象；
        }
        // let arr = mysplit(str,'split'," ")
        // console.log(arr)

        // instanceof 判断会根据原型链进行判断
        let arr = [];
        let obj = {};
        // console.log(arr instanceof Array) // True
        // console.log(arr instanceof Object) // True
        // console.log(typeof arr) // object
        // console.log(typeof obj) // object

        let res = Object.prototype.toString.call(arr) //[object Array]
        let res2 = Object.prototype.toString.call(obj) //[object Object]
        console.log(res,res2)




    </script>

</body>

</html>